{% extends "base.html" %}

{% block title %}申请成为创作者{% endblock %}

{% block content %}
<div class="container mt-4">
    <div class="row justify-content-center">
        <div class="col-md-8">
            <div class="card">
                <div class="card-header">
                    <h4>申请成为创作者</h4>
                </div>
                <div class="card-body">
                    {% with messages = get_flashed_messages(with_categories=true) %}
                        {% if messages %}
                            {% for category, message in messages %}
                                <div class="alert alert-{{ category }} alert-dismissible fade show" role="alert">
                                    {{ message }}
                                    <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
                                </div>
                            {% endfor %}
                        {% endif %}
                    {% endwith %}

                    <form method="POST" action="{{ url_for('apply_creator') }}">
                        <div class="mb-3">
                            <label for="bio" class="form-label">个人简介 <span class="text-danger">*</span></label>
                            <textarea class="form-control" id="bio" name="bio" rows="3" 
                                      placeholder="介绍一下你自己和你的创作方向" required>{{ bio }}</textarea>
                            <div class="form-text">这将展示在你的创作者主页上</div>
                        </div>
                        
                        <div class="mb-3">
                            <label for="specialty" class="form-label">专长领域 <span class="text-danger">*</span></label>
                            <input type="text" class="form-control" id="specialty" name="specialty"
                                   placeholder="例如: 编程教程、美食评测、旅行Vlog等" 
                                   value="{{ specialty }}" required>
                        </div>
                        
                        <div class="mb-3">
                            <label for="social_links" class="form-label">社交媒体链接</label>
                            <input type="text" class="form-control" id="social_links" name="social_links"
                                   placeholder="例如: 微博、B站、YouTube等链接，多个链接用逗号分隔"
                                   value="{{ social_links }}">
                            <div class="form-text">方便粉丝在其他平台关注你</div>
                        </div>
                        
                        <div class="d-grid gap-2">
                            <button type="submit" class="btn btn-primary">提交申请</button>
                            <a href="{{ url_for('creator_center') }}" class="btn btn-outline-secondary">取消</a>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}
